class Tunnel < Sketch3D
  def container
    super do
      object :class => PHelper::CameraMouse do
        block { background 0 }

        add_box = lambda { |speed, size, depth|
          box :tz => -0.4 * depth, :sx => size, :sy => size, :sz => size, :fill => [0, 0, 0.7, 0.10], :stroke => [0, 0, 0, 1 - (depth / 30.0)] do
            block do
              @rz = (frameCount * speed * depth)
              @rx = (frameCount * speed * depth * 2)
            end
          end
        }

        (0..30).each do |x|
          add_box.call 0.001, 1.8, x
        end
      end
    end
  end
end
